﻿
@{
    Layout = "~/Views/Shared/_JSLayout.cshtml";
    ViewBag.Title = "登录";
    string gotoUrl = ViewBag.gotoUrl;
}

<!DOCTYPE html>
<html>
<head>
    <title>模拟登陆页面</title>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">    
    <link href="~/Content/css/shop/login.css" rel="stylesheet" />
    <link href="~/Content/css/shop/global.css" rel="stylesheet" />    
</head>
<body>
    <div class="login">
        <div class="login-title">
            <p>辣时光登录</p>
            <i></i>
        </div>
       
            <div class="login-bar">
                <ul>                   
                    <li><img src="~/Content/Image/shop/login_user.png"><input type="text" id="userCode" class="text" placeholder="请输入用户名" /></li>
                    <li><img src="~/Content/Image/shop/login_pwd.png"><input type="password" id="password" class="psd" placeholder="请输入确认密码" /></li>
                </ul>
            </div>
            <div class="login-btn">
                <button class="submit" onclick="submit()">登陆</button>
                @*<a href="register.html"><div class="login-reg"><p>莫有账号，先注册</p></div></a>*@
            </div>
        
    </div>
</body>
</html>
<script type="text/javascript">

    function submit() {
        var usercode = $("#userCode").val();
        var key = $("#password").val();
        var gotourl = "@(gotoUrl)";
        layer.open({ type: 2 });
          $.ajax({
                 url: "@(ViewBag.Domain+ "/Login/LoginByMaual")",
            type: 'post',
            cache: 'false',
            async: 'false',
            data: { userCode: usercode, pwd: key, gotourl: gotourl },
            success: function (data) {                
                if (data.Success == true) {
                    window.location.href = data.Data + "?id=" + 10000 * Math.random();
                } else {
                    layer.open({ content: data.Data });
                    
                }
                   },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
            
                }
            });
    }

</script>